package controllers;

import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.Security;

public class Securedoff extends Security.Authenticator {

	public String getUsername(Context ctx) {
		if (ctx.session().get("login").equalsIgnoreCase("Admin")) {
			return ctx.session().get("login");
		} else {
			return null;
		}
	}

	public Result offUnauthorized(Context ctx) {
		return redirect(controllers.routes.Application.login());
	}
}
